﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Configuration;

public partial class login_izvele : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (User.Identity.IsAuthenticated == false)
        { Server.Transfer("login_aizliegts.aspx"); }
        else
        {
         //   ShopLogIn();
        }
    }

    void ShopLogIn()
    {
        FormsAuthentication.SetAuthCookie("EpisLog", false);
        //modify the Domain attribute of the cookie to the second level of domain
        System.Web.HttpCookie MyCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(User.Identity.Name.ToString(), false);
        MyCookie.Domain = ConfigurationManager.AppSettings["Level2DomainName"];//like miscrosoft.com, dell.com...
        Response.AppendCookie(MyCookie);
    }
}
